import 'package:fish_redux/fish_redux.dart';

import 'action.dart';
import 'state.dart';

Reducer<FindState> buildReducer() {
  return asReducer(
    <Object, Reducer<FindState>>{
      FindAction.action: _onAction,
      FindAction.upSelect: _upselect,

    },
  );
}

FindState _onAction(FindState state, Action action) {
  final FindState newState = state.clone();
  return newState;
}

FindState _upselect(FindState state, Action action) {
  final FindState newState = state.clone();
 newState.selectIndex = action.payload;
return newState;
}